
#include "node_i2c.h"
#include "serialization/asn1.h"
//	#include "nrf_log.h"
#include <stdio.h>
#include "t1.h"
#include "router.h"
#include "Debug.h"

int node_i2c_handler(t1_inf_t *inf, uint16_t len)
{
  LOG_I(" i2c ");
  static uint8_t apdu[512];
  static t1_inf_t constructed_inf = {
  .payload = apdu
  };
  static /*t1_len_t*/ uint16_t constructed_len;
  // unwrap i2c command
  asn1_i2c_unwrap(inf, &constructed_inf, &constructed_len);
  // and re-route
  return router_route(&constructed_inf, constructed_len);
}

